<?php

$username = 'admin';
$password = '123456';

	session_start();
	
	if($_SERVER['REQUEST_METHOD'] == 'POST'){
	
		if($_POST['username'] == $username && $_POST['password'] == $password){
		$_SESSION['admin_user'] = true;
		header("Location: index.php");
		}
		
		else{
		$results = '<span id="result">Error: username / password incorrect.</span>';
		}
	
	}
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Admin Area</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="library/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="library/print.css" media="print" />
<script type="text/javascript" src="library/jquery.js"></script>
<script type="text/javascript" src="library/global.js"></script>
</head>
<body>
<div id="container">
<div id="header_bg">
<div id="layout">

<div id="header">
<div id="header_left"><h1><a href="/admin">Admin Control Panel</a></h1></div>
</div>

<div id="navigation"></div>

<div id="content">

<h1 id="page_header">Welcome</h1>

<div id="login_box_wrapper">
	<div id="login_box">
	<h2 class="container_header">Login</h2>
	<?php echo (strlen($results) > 0) ? $results : '<span id="info">Please enter your username and password.</span>'; ?>
	<form method="post" action="">
	<input type="text" name="username" id="username" value="Username" onfocus="if(this.value == 'Username'){this.value = '';}" class="text_box" />
	<input type="password" name="password" id="password" value="Password" onfocus="if(this.value == 'Password'){this.value='';}" class="text_box" />
	<input type="image" src="images/login_button.png" alt="Login" />
	</form>
	</div>
</div>


</div>

</div>
</div>

<div id="footer">Admin Control Panel - <a href="http://www.kevinchoppin.co.uk" target="_blank">Kevin Choppin</a> &copy; <?php echo date("Y"); ?></div>

</div>
</body>
</html>